package com.texaco.chapasFutbol.resources;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

import android.graphics.Color;

/**
 * Clase que mantendrá de forma estática todos los recursos
 * @author texaco
 *
 */
public class Resources {

	/*
	 * SHAPES
	 */
	public static final String GOAL_SHAPE = "GOAL_SHAPE";
	public static final String BG_GOAL_SHAPE = "BG_GOAL_SHAPE";
	public static final String MONIGOTE_GOAL_SHAPE = "MONIGOTE_GOAL_SHAPE";
	public static final String SHAPE_CHAPA_LOCAL = "SHAPE_CHAPA_LOCAL";
	public static final String SHAPE_CHAPA_VISITANTE = "SHAPE_CHAPA_VISITANTE";
	public static final String SHAPE_SOMBRA_CHAPA = "SHAPE_SOMBRA_CHAPA";
	public static final String SHAPE_BALON = "SHAPE_BALON";
	public static final String SHAPE_SOMBRA_BALON = "SHAPE_SOMBRA_BALON";
	public static final String SHAPE_TIRADOR = "SHAPE_TIRADOR";
	public static final String SHAPE_CHUT_OK = "SHAPE_CHUT_OK";
	public static final String SHAPE_CHUT_CANCEL = "SHAPE_CHUT_CANCEL";
	public static final String SHAPE_GROUND_LINES = "SHAPE_GROUND_LINES";
	public static final String PRINCIPAL_2JUGADORES_SHAPE = "PRINCIPAL_2JUGADORES_SHAPE";
	public static final String PRINCIPAL_MULTI_ONLINE_SHAPE = "PRINCIPAL_MULTI_ONLINE_SHAPE";
	public static final String PRINCIPAL_OPCIONES_SHAPE = "PRINCIPAL_OPCIONES_SHAPE";
	public static final String SHAPE_TUTORIAL_1 = "SHAPE_TUTORIAL_1";
	public static final String SHAPE_TUTORIAL_2 = "SHAPE_TUTORIAL_2";
	public static final String SHAPE_TUTORIAL_3 = "SHAPE_TUTORIAL_3";
	public static final String SHAPE_TUTORIAL_4 = "SHAPE_TUTORIAL_4";
	public static final String SHAPE_TUTORIAL_5 = "SHAPE_TUTORIAL_5";
	public static final String SHAPE_TUTORIAL_PANEL = "SHAPE_TUTORIAL_PANEL";
	
	/*
	 * SOUNDS
	 */
	public static final String SOUND_GOL = "SOUND_GOL";
	public static final String SOUND_SILBATO = "SOUND_SILBATO";
	public static final String SOUND_SILBATO_FIN = "SOUND_SILBATO_FIN";
	public static final String SOUND_CLICK = "SOUND_CLICK";
	public static final String SOUND_SPLASH = "SOUND_SPLASH";
	public static final String SOUND_CHUTE = "SOUND_CHUTE";
	public static final String SOUND_CHAPAS = "SOUND_CHAPAS";
	
	/*
	 * MUSIC
	 */
	public static final String MUSIC_PRINCIPAL = "MUSIC_PRINCIPAL";
	public static final String MUSIC_CREDITS = "MUSIC_CREDITS";
	public static final String MUSIC_SUMMARY = "MUSIC_SUMMARY";
	public static final String MUSIC_CROWD = "MUSIC_CROWD";
	
	/*
	 * FONTS
	 */
	public static final String FONT_DEFAULT = "FONT_DEFAULT";
	public static final String FONT_HUD = "FONT_HUD";
	public static final String FONT_OPTIONS = "FONT_OPTIONS";
	public static final String FONT_TUTORIAL = "FONT_TUTORIAL";
	public static final String FONT_OPTIONS_SUBCAPTION = "FONT_OPTIONS_SUBCAPTION";
	public static final String FONT_OPTIONS_CAPTION = "FONT_OPTIONS_CAPTION";
	public static final String FONT_PRINCIPAL_BIG = "FONT_PRINCIPAL_BIG";
	public static final String FONT_PRINCIPAL_SMALL = "FONT_PRINCIPAL_SMALL";
	public static final String FONT_SPLASH = "FONT_SPLASH";
	
	/*
	 * VECTORS
	 */
	public static final String VECTOR_CIRCULO = "VECTOR_CIRCULO";
	public static final String VECTOR_MUSIC_ON = "VECTOR_MUSIC_ON";
	public static final String VECTOR_MUSIC_OFF = "VECTOR_MUSIC_OFF";
	public static final String VECTOR_SFX_ON = "VECTOR_SFX_ON";
	public static final String VECTOR_SFX_OFF = "VECTOR_SFX_OFF";
	
	/*
	 * ATLAS
	 */
	public static final String ATLAS_BOTONES = "ATLAS_BOTONES";
	public static final String ATLAS_SPRITE = "ATLAS_SPRITE";
	public static final String ATLAS_BG_GOL = "ATLAS_BG_GOL";
	public static final String ATLAS_MONIGOTE_GOL = "ATLAS_MONIGOTE_GOL";
	public static final String ATLAS_PORTERIA = "ATLAS_PORTERIA";
	public static final String ATLAS_LINEAS_CAMPO = "ATLAS_LINEAS_CAMPO";
	public static final String ATLAS_BOTONES_PPAL = "ATLAS_BOTONES_PPAL";
	public static final String ATLAS_TUTORIAL = "ATLAS_TUTORIAL";
	public static final String ATLAS_TUTORIAL_RESOURCES = "ATLAS_TUTORIAL_RESOURCES";
	
	public static Map<String, Atlas> graphicResources = new HashMap<String, Atlas>(){

		/**
		 * 
		 */
		private static final long serialVersionUID = -4977338400908704728L;
		
		{
			put(ATLAS_PORTERIA, new Atlas(86, 294, "goal-left.png", null, new HashMap<String, Resource>(){
				/**
				 * 
				 */
				private static final long serialVersionUID = -5319230722431071831L;

				{
					put(GOAL_SHAPE, new Resource(86, 294, 0, 0, null, GOAL_SHAPE));
					}
			}));
			
			put(ATLAS_BG_GOL, new Atlas(1480, 1000, "bg-gol.png", null, new HashMap<String, Resource>(){
				/**
				 * 
				 */
				private static final long serialVersionUID = 8379932941807324785L;

				{
					put(BG_GOAL_SHAPE, new Resource(1480, 1000, 0, 0, null, BG_GOAL_SHAPE));
					}
			}));

			put(ATLAS_MONIGOTE_GOL, new Atlas(1480, 1000, "monigote1.png", null, new HashMap<String, Resource>(){

				/**
				 * 
				 */
				private static final long serialVersionUID = -2683973236287751594L;

				{
					put(MONIGOTE_GOAL_SHAPE, new Resource(1079, 799, 0, 0, null, MONIGOTE_GOAL_SHAPE));
					}
			}));

			put(ATLAS_SPRITE, new Atlas(600, 120, "balones-y-chapas.png", null, new HashMap<String, Resource>(){
				/**
				 * 
				 */
				private static final long serialVersionUID = 8379932941807324785L;

				{
//					put(SHAPE_CHAPA_LOCAL, new Resource(70, 70, 10, 0, null, SHAPE_CHAPA_LOCAL));
//					put(SHAPE_CHAPA_VISITANTE, new Resource(70, 70, 91, 0, null, SHAPE_CHAPA_VISITANTE));
//					put(SHAPE_SOMBRA_CHAPA, new Resource(70, 70, 171, 6, null, SHAPE_SOMBRA_CHAPA));
//					put(SHAPE_BALON, new Resource(42, 42, 252, 5, null, SHAPE_BALON));
//					put(SHAPE_SOMBRA_BALON, new Resource(48, 48, 356, 16, null, SHAPE_SOMBRA_BALON));
//					put(SHAPE_TIRADOR, new Resource(47, 47, 427, 18, null, SHAPE_TIRADOR));
					put(SHAPE_CHAPA_LOCAL, new Resource(67, 67, 3, 26, null, SHAPE_CHAPA_LOCAL));
					put(SHAPE_CHAPA_VISITANTE, new Resource(67, 67, 86, 25, null, SHAPE_CHAPA_VISITANTE));
					put(SHAPE_SOMBRA_CHAPA, new Resource(80, 80, 160, 25, null, SHAPE_SOMBRA_CHAPA));
					put(SHAPE_BALON, new Resource(42, 42, 244, 30, null, SHAPE_BALON));
					put(SHAPE_SOMBRA_BALON, new Resource(55, 55, 295, 25, null, SHAPE_SOMBRA_BALON));
					put(SHAPE_TIRADOR, new Resource(95, 95, 360, 15, null, SHAPE_TIRADOR));
				}
			}));

			put(ATLAS_BOTONES, new Atlas(1050, 233, "accept-icon.png", null, new HashMap<String, Resource>(){
				/**
				 * 
				 */
				private static final long serialVersionUID = 8379932941807324785L;

				{
					put(SHAPE_CHUT_OK, new Resource(210, 233, 295, 0, null, SHAPE_CHUT_OK));
					put(SHAPE_CHUT_CANCEL, new Resource(210, 233, 777, 0, null, SHAPE_CHUT_CANCEL));
					}
			}));

			put(ATLAS_LINEAS_CAMPO, new Atlas(1261, 773, "lineas-campo.png", null, new HashMap<String, Resource>(){
				/**
				 * 
				 */
				private static final long serialVersionUID = 8379932941807324785L;

				{
					put(SHAPE_GROUND_LINES, new Resource(1261, 773, 0, 0, null, SHAPE_GROUND_LINES));
					}
			}));

			put(ATLAS_BOTONES_PPAL, new Atlas(413, 414, "botones-intro.png", null, new HashMap<String, Resource>(){
				/**
				 * 
				 */
				private static final long serialVersionUID = 8379932941807324785L;

				{
					put(PRINCIPAL_2JUGADORES_SHAPE, new Resource(185, 194, 0, 0, null, PRINCIPAL_2JUGADORES_SHAPE));
					put(PRINCIPAL_MULTI_ONLINE_SHAPE, new Resource(185, 194, 229, 0, null, PRINCIPAL_MULTI_ONLINE_SHAPE));
					put(PRINCIPAL_OPCIONES_SHAPE, new Resource(185, 194, 0, 220, null, PRINCIPAL_OPCIONES_SHAPE));
					}
			}));

			put(ATLAS_TUTORIAL, new Atlas(1191, 252*5, null, null, new LinkedHashMap<String, Resource>(){
				/**
				 * 
				 */
				private static final long serialVersionUID = 8379932941807324785L;

				{
					put(SHAPE_TUTORIAL_1, new Resource(1132, 251, 0, 0, "tutorial1.jpg", SHAPE_TUTORIAL_1));
					put(SHAPE_TUTORIAL_2, new Resource(1132, 251, 0, 252, "tutorial2.jpg", SHAPE_TUTORIAL_2));
					put(SHAPE_TUTORIAL_3, new Resource(1132, 251, 0, 252*2, "tutorial3.jpg", SHAPE_TUTORIAL_3));
					put(SHAPE_TUTORIAL_4, new Resource(1132, 251, 0, 252*3, "tutorial4.jpg", SHAPE_TUTORIAL_4));
					put(SHAPE_TUTORIAL_5, new Resource(1132, 251, 0, 252*4, "tutorial5.jpg", SHAPE_TUTORIAL_5));
					}
			}));

			put(ATLAS_TUTORIAL_RESOURCES, new Atlas(1191, 568, null, null, new HashMap<String, Resource>(){
				/**
				 * 
				 */
				private static final long serialVersionUID = 8379932941807324785L;

				{
					put(SHAPE_TUTORIAL_PANEL, new Resource(1191, 568, 0, 0, "panel-tutorial.png", SHAPE_TUTORIAL_PANEL));
					}
			}));
		}
	};
	
	public static Map<String, String> soundFXResources = new HashMap<String, String>(){

		/**
		 * 
		 */
		private static final long serialVersionUID = 5579795216944033355L;
		
		{
			put(SOUND_GOL, "gol.ogg");
			put(SOUND_SILBATO, "silbato.ogg");
			put(SOUND_SILBATO_FIN, "silbatoFin.ogg");
			put(SOUND_CLICK, "click.ogg");
			put(SOUND_SPLASH, "laser.ogg");
			put(SOUND_CHUTE, "balon.ogg");
			put(SOUND_CHAPAS, "chapas.ogg");
		}
		
	};
	
	public static Map<String, String> soundMusicResources = new HashMap<String, String>(){

		/**
		 * 
		 */
		private static final long serialVersionUID = 5579795216944033355L;
		
		{
			put(MUSIC_PRINCIPAL, "principal.ogg");
			put(MUSIC_CREDITS, "creditos.ogg");
			put(MUSIC_SUMMARY, "resultado.ogg");
			put(MUSIC_CROWD, "ambiente.ogg");
		}
		
	};
	
	public final static Map<String, Font> fonts = new HashMap<String, Font>(){
		
		/**
		 * 
		 */
		private static final long serialVersionUID = 7666045853206559045L;

		{
			put(FONT_DEFAULT, new Font("Plok.ttf", 52, Color.RED));
			put(FONT_HUD, new Font("Gorditas-Regular.ttf", 32, Color.WHITE));
			put(FONT_OPTIONS, new Font("Gorditas-Regular.ttf", 46, Color.WHITE));
			put(FONT_TUTORIAL, new Font("Gorditas-Regular.ttf", 32, Color.WHITE));
			put(FONT_OPTIONS_SUBCAPTION, new Font("Gorditas-Regular.ttf", 45, Color.GRAY));
			put(FONT_OPTIONS_CAPTION, new Font("Gorditas-Bold.ttf", 52, Color.GRAY));
			put(FONT_PRINCIPAL_BIG, new Font("Gorditas-Bold.ttf", 60, Color.WHITE));
			put(FONT_PRINCIPAL_SMALL, new Font("Gorditas-Bold.ttf", 30, Color.WHITE));
//			put(FONT_SPLASH, new Font("Droid.ttf", 58, Color.rgb(218, 165, 32)));
			put(FONT_SPLASH, new Font("Droid.ttf", 58, Color.BLACK));
		}
	};
	public final static Map<String, Resource> vectors = new HashMap<String, Resource>(){
		/**
		 * 
		 */
		private static final long serialVersionUID = -999621238905995748L;

		{
			put(VECTOR_CIRCULO, new Resource(246, 246, 0, 0, "circulo.svg", null));
			put(VECTOR_MUSIC_ON, new Resource(110, 110, 0, 0, "musicOn.svg", null));
			put(VECTOR_MUSIC_OFF, new Resource(110, 110, 0, 0, "musicOff.svg", null));
			put(VECTOR_SFX_ON, new Resource(110, 110, 0, 0, "sfxOn.svg", null));
			put(VECTOR_SFX_OFF, new Resource(110, 110, 0, 0, "sfxOff.svg", null));
		}
	};
}
